<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	template="/xhtml/templates/layout.xhtml">

	<ui:define name="title">#{msgs.titleLogin}</ui:define>

	<ui:define name="content">
	
		<h:form id="login" prependId="false"
			onsubmit="document.#{p:component('login')}.action='j_security_check';">
			<h:panelGrid id="loginGrid" columns="3" columnClasses="alignright">
				<h:outputText for="j_username" value="${msgs.username}" />
				<p:inputText id="j_username" required="true">
					<f:validateLength minimum="4" />
					<f:validateRequired />
					<p:ajax event="blur" update="msgj_username" />
				</p:inputText>
				<h:message id="msgj_username" for="j_username" />

				<h:outputText for="j_password" value="${msgs.password}" />
				<p:password id="j_password" required="true">
					<f:validateLength minimum="4" />
					<f:validateRequired />
					<p:ajax event="blur" update="msgj_password" />
				</p:password>
				<h:message id="msgj_password" for="j_password" />
				<p/>
				<p:commandButton
					onclick="document.#{component.clientId}.action='j_security_check';"
					value="${msgs.login}" />
				<p/>
			</h:panelGrid>
		</h:form>
		<script>
   			$('#j_password input').attr('name', 'j_password');
		</script>
	</ui:define>

</ui:composition>